package com.example.springboot.config.amqp.rabbitmq.delayqueue;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/10/22 10:38
 */
@Component
@Slf4j
@RabbitListener(queues = QueueConfig.DLX_QUEUE_NAME) // 监听这个队列
public class DlxConsumer {
    @RabbitListener(queues = QueueConfig.DLX_QUEUE_NAME) // 监听这个队列
    public void handle(String msg) {
        log.info("进入死信队列了===="+msg);
//    }
//    @RabbitHandler
//    public void handle(String msg, Message message, Channel channel) {
//        log.info(msg);
//    }
    }
}
